package com.eorchis.module.trainneedscope.domain;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.module.trainingquestionnaire.domain.QuestionnaireEntity;

/**
 * Title: TrainNeedScope<br>
 * Description: 培训需求调查对象实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author Max
 * @createDate 2014-08-27
 * @version $Revision$
 */
@Entity
@Table(name = "QUESTIONNAIRE_SURVEY_OBJECT")
public class TrainNeedScope implements IBaseEntity {
	private static final long serialVersionUID = 1L;
	
	public static final Integer ACTIVE_STATE_Y=1;
	public static final Integer ACTIVE_STATE_N=1;
	public static final Integer SURVER_TYPE_DEPT=1;
	public static final Integer SURVER_TYPE_USER=2;
	
	private String questionnaireSurveyObjectId;//ID
	//private String questionnaireId;//问卷id
	private QuestionnaireEntity questionnaire;
	private String surveyObjectId;//调查对象id
	private Integer surveyObjectType;//调查类型
	private Integer writeType;//填写类型
	private Integer activeState;//活动状态 
	private Date createDate;//创建时间 
	private String dutyCodes;
	
	/**
	 * 获取ID
	 */	
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="QUESTIONNAIRE_SURVEY_OBJECT_ID")
	public String getQuestionnaireSurveyObjectId() {
		return questionnaireSurveyObjectId;
	}
	/**
	 * 设置ID
	 */		
	public void setQuestionnaireSurveyObjectId(String questionnaireSurveyObjectId) {
		this.questionnaireSurveyObjectId = questionnaireSurveyObjectId;
	}

	/**
	 * 获取调查对象id
	 */	
	@Column(name="SURVEY_OBJECT_ID")
	public String getSurveyObjectId() {
		return surveyObjectId;
	}
	/**
	 * 设置调查对象id
	 */		
	public void setSurveyObjectId(String surveyObjectId) {
		this.surveyObjectId = surveyObjectId;
	}
	/**
	 * 获取调查类型
	 */	
	@Column(name="SURVEY_OBJECT_TYPE")
	public Integer getSurveyObjectType() {
		return surveyObjectType;
	}
	/**
	 * 设置调查类型
	 */		
	public void setSurveyObjectType(Integer surveyObjectType) {
		this.surveyObjectType = surveyObjectType;
	}
	/**
	 * 获取填写类型
	 */	
	@Column(name="WRITE_TYPE")
	public Integer getWriteType() {
		return writeType;
	}
	/**
	 * 设置填写类型
	 */		
	public void setWriteType(Integer writeType) {
		this.writeType = writeType;
	}
	
	
	/**
	 * 获取活动状态
	 */	
	@Column(name="ACTIVE_STATE")
	public Integer getActiveState() {
		return activeState;
	}
	/**
	 * 设置活动状态
	 */	
	public void setActiveState(Integer activeState) {
		this.activeState = activeState;
	}
	/**
	 * 获取创建时间
	 */	
	@Column(name="CREATE_DATE")
	public Date getCreateDate() {
		return createDate;
	}
	/**
	 * 设置创建时间
	 */	
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	/**
	 * 获取指标ID
	 */	
	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name = "QUESTIONNAIRE_ID", referencedColumnName = "QUESTIONNAIRE_ID")
	public QuestionnaireEntity getQuestionnaire() {
		return questionnaire;
	}
	public void setQuestionnaire(QuestionnaireEntity questionnaire) {
		this.questionnaire = questionnaire;
	}
	
	@Column(name="DUTY_CODES")
	public String getDutyCodes() {
		return dutyCodes;
	}
	public void setDutyCodes(String dutyCodes) {
		this.dutyCodes = dutyCodes;
	}
	
	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "ID======>" + getQuestionnaireSurveyObjectId()+"\n问卷id======>"+"\n调查对象id======>" + getSurveyObjectId()+"\n调查类型======>" + getSurveyObjectType()+"\n填写类型======>" + getWriteType();
	}
}
